
/** 弹窗显示 */

import React from "react";

export default function useVisible(v = false) {

    const [isOpen, setOpen] = React.useState(v);

    const onCancel = React.useCallback(() => { setOpen(false) }, [])

    const onOpen = React.useCallback(() => { setOpen(true) }, [])

    return { isOpen, onCancel, onOpen }
}